package com.apex.crm.base;

import org.springframework.dao.DataAccessException;

import java.util.List;

public interface BaseMapper<T,ID> {

    //添加记录返回行数
    public Integer insertSelective(T entity) throws DataAccessException;

    //添加记录返回主键
    public Integer insertHasKey(T entity) throws DataAccessException;

    //批量添加
    public Integer insertBatch(List<T> entities)throws DataAccessException;

    //根据ID查询详情
    public T selectByPrimaryKey(ID id) throws  DataAccessException;

    //多条件查询
    public List<T> selectByParams(BaseQuery baseQuery) throws DataAccessException;

    //更新单条记录
    public Integer updateByPrimaryKeySelective(T entity) throws DataAccessException;


    //批量删除

    public Integer deleteBatch(ID[] ids) throws DataAccessException;





}
